/*
 * Loop.h
 */

#ifndef LOOP_H_
#define LOOP_H_


#include <iostream>

#include "GL_Window.h"
#include "Timer.h"
#include "Level.h"
#include "Player.h"
#include "ObjModel.h"
#include "Skybox.h"

class Loop : public GL_Writer
{
public:
	Loop(GL_Window *window);
	virtual ~Loop();

	void run();
	bool initialize();
	bool setupView();
	void update (float milliseconds);
	void draw (void);
	void createObjects();
	void destroyObjects();

private:
	GL_Window 	*window;
	Timer 		*timer;
	GL_Writer 	*writer;
	Level 		*level;
	Player		*player1;
	Player		*player2;
	Skybox		*skybox;

	ObjModel *bonuses[4];
	float scale;
	float change;

	Model3D		*test;

	/* Keys structure from GL_Window*/
	Keys *keys;

	/* Program active check variable */
	bool isRunning;
	/* Fill mode or lines only*/
	bool polyMode;

	/* Variables for user control of characters */
	float px;
	float py;
	float pz;
	float rx;
	float ry;
	float rz;

	GLuint red_win;
	GLuint blue_win;

};

#endif /* LOOP_H_ */
